package com.tepth.vehiclemaintenance.mvp.work.search;

import com.tepth.vehiclemaintenance.base.BaseModel;
import com.tepth.vehiclemaintenance.base.BasePresenter;
import com.tepth.vehiclemaintenance.base.BaseView;
import com.tepth.vehiclemaintenance.bean.MaintainListWork;
import com.tepth.vehiclemaintenance.bean.SearchPartResult;
import com.tepth.vehiclemaintenance.net.ApiModel;

import java.util.ArrayList;

import io.reactivex.Observable;

/**
 * Created by zhangyu on 2017/5/16.
 */

public class SearchContract {

    interface View extends BaseView {
        String getAuthKey();

        String getName();

        int getCount();

        void showSearchResult(int accessorySize,
                              int componentSize,
                              ArrayList<MaintainListWork.ListContentsBean.ListRemarkBean.AccessoryBean> list);

        void showCommonComponents(int accessorySize,
                                  int componentSize,
                                  ArrayList<MaintainListWork.ListContentsBean.ListRemarkBean.AccessoryBean> list);
    }

    interface Model extends BaseModel {
        Observable<ApiModel<SearchPartResult>> searchPart(String authKey, String name);

        Observable<ApiModel<SearchPartResult>> getCommonComponents(String authKey, int count);
    }

    abstract static class Presenter extends BasePresenter<Model, View> {

        @Override
        public void onStart() {

        }
        abstract void search();

        abstract void getCommonComponents();
    }
}